<!--<form method="post"  action="--><?php //xcho(url('/ajax/mould/sendsms/index')) ?><!--">-->
<!doctype html>
<html lang="en" class="fixed">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>学员列表</title>
    <!-- <link type="text/css" rel="stylesheet" href="../../topjui/plugins/layui/css/layui.css"> -->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" type="text/css"  href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap-datetimepicker.min.css')) ?>">
    <link rel="stylesheet" type="text/css" href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/build_standalone.css')) ?>">
    <link rel="stylesheet" type="text/css"  href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/build.css')) ?>">

    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?>">

    <style>
        .form-control{
            width: inherit;
            display: inline-block;
        }
        .form-group label{
            float: left;
        }
        .row{
            margin-top: 20px;
        }
    </style>
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
    
</head>
   <body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
   <div class="container">
       <h4>发送短信</h4>
       <div class="row">
           <div class="col-sm-12 col-md-12 form-container">
               <div class="form-group">
                   <label>发送时间：</label>
                   <input size="16" type="text" value="" name="send_time" class="form-control send_tme" placeholder="yyyy-mm-dd hh:ii:ss" id="date">
               </div>
               <div class="form-group">
                   <label>短信内容：</label>

                   <select name="mould_id" id="mould_id"  class="form-control">
                       <option value="">请选择</option>
                       <?php foreach ($mouldlist as $m) { ?>
                           <option value="<?php xchoHtml($m['message']) ?>" id="<?php
                           xcho($m['id'])?>"><?php xcho($m['title']) ?></option>
                       <?php } ?>
                   </select>
               </div>
               <div class="form-group">
                   <label style="visibility: hidden;">发送内容：</label>
                   <textarea name="message" id="message_info"  class="form-control" rows="5" cols="100"></textarea>
               </div>
               <div class="form-group">
                   <label>发送号码:</label>
                   <textarea name="cellphone" rows="5" cols="100" class="form-control" style="margin-left: 10px;"><?php xcho($cellphone)?></textarea>
                   <span style="color: red">批量发送时,手机号码回车换行即可</span>
               </div>
               <div class="form-group">
                   <label style="visibility: hidden;">发送内容：</label>
                   <span name="btn_send" class="btn btn-info btn_send">发送</span>
               </div>
           </div>
       </div>
   </div>
   <!--</form>-->
   <input type="hidden" name="sendUrl" value="<?php xcho($sendUrl) ?>" />
   <script src="<?php xcho(loadSource('/assets/plugins/jquery/jquery.min.js')) ?>"></script>
   <script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap.min.js')) ?>"></script>
   <script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap-datetimepicker.min.js')) ?>"></script>
   <script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap-datetimepicker.fr.js')) ?>"></script>
   <script src="<?php xcho(loadSource('/assets/plugins/bootstrap/js/bootstrap-datetimepicker.zh-CN.js')) ?>"></script>
   <script src="<?php xcho(loadSource('/assets/plugins/layui/layui.all.js')) ?>" charset="utf-8"></script>
   <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery
/jquery-1.4.min.js"></script>
   <script>

var layer = layui.layer
    , form = layui.form, laydate = layui.laydate;
laydate.render({
    elem: '#date'
    ,type: 'datetime',
});
       $(function () {
           $('#mould_id').change(function () {
               var mould_id_value=$("#mould_id").val();
               $("#message_info").text(mould_id_value);
           })
       })

       $(document).ready(function(){
           $('.btn_send').click(function () {
               var send_time=$("input[name='send_time']").val();
//                var mould_id=$("select[name='mould_id'] option:selected").val();
               var mould_id=$("#mould_id").find("option:selected").attr("id");
               var message=$("textarea[name='message']").val();
               var cellphone=$("textarea[name='cellphone']").val();
               var url=$("input[name='sendUrl']").val();
               if(message==null||message==''){
                   alert('内容不能为空');
                   return false;
               }
               if(cellphone==null||message==''){
                   alert('手机号码不能为空');
                   return false;
               }
               $.ajax({
                   url:url,
                   type:'post',
                   dataType:'json',
                   data:{send_time:send_time,mould_id:mould_id,message:message,cellphone:cellphone},
                   success:function (resp) {
                       if(resp.success ==1){
                           alert('短信已经发送'+resp.total+'条');
                           location.href = "/sms/Sendsms/index";
                       }else {
                           alert(resp.msg);
                       }
                   }
               })
           })
       });
   </script>
   <?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>
   <button id="top" style="height: 50px;width: 50px;"></button></body>
</html>